<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateItemsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('items', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->text('describe');
            $table->enum('type', ['find', 'lost'])->key()->default('lost');
            $table->integer('user_id')->key();
            $table->integer('p_catalog_id')->key();
            $table->integer('catalog_id')->key();
            $table->integer('province_id')->key();
            $table->integer('city_id')->key();
            $table->integer('district_id')->key();
            $table->string('place', 200);
            $table->datetime('lost_time');
            $table->datetime('find_time');
            $table->datetime('match_time');
            $table->datetime('done_time');
            $table->decimal('wanted_fee', 10, 2);
            $table->decimal('fee', 10, 2);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('items');
    }

}
